<template>
<div class="login">

  <div class="befor">
    <div>realme 官网</div>
    <div>帮助中心 <select style="outline: none;border: none">
      <option>繁体中文</option>
      <option selected="selected">简体中文</option>
      <option>English</option>
    </select>
    </div>

  </div>
  <h1 class="biao" >realme</h1>
  <div class="box1">
    <div class="box2">账号登录</div>

    <div class="boxphone">
      <input class="btn" style="width:80%" type="text" placeholder=" 请输入手机号码" v-model="user.uname">
    </div>


    <div class="boxphone">
      <input class="btn" style="width:80%" type="password" placeholder=" 请输入密码" v-model="user.upwd">
    </div>


    <div class="boxphone">
      <button class="btn1" name="subme" style="width: 320px" @click="login">登录</button>
    </div>
    <div class="boxtext">
      <div>隐私政策</div>
      <div class="textsize"><a href="/register"> 注册账号</a></div>
    </div>
    <div style="margin-top:20px">
      ———— 其他登录方式 ————
    </div>
    <div style="margin-top:20px">
      <img src="../../assets/images/QQ.png">
    </div>
    <div class="geshi">
      <span class="buttom">欢太为realme用户提供账号服务</span>
    </div>
    <div class="geshi2">
      <span class="buttom2">©2005-2021 广东欢太 版权所有 粤ICP备 14056724 号-2</span>
    </div>

  </div>
</div>
</template>

<script>
import axios  from "axios";
export default {
  name: "Rlogin",
  data(){
    return{
      user:{
        uname:"",
        upwd:""
      }
    }
  },
  methods:{
    //用户登录
    login()
    {
      //发送登录请求
      axios.post("http://192.168.0.239:8081/user/login", this.user).then(res => {
        if (res.data.state) {
          alert(res.data.msg + ",点击确定进入主页!");
          location.href="/";
        } else {
          alert(res.data.msg);
        }
      });

    }

  }
}
</script>

<style scoped>

</style>
<style src="../../assets/CSS/login.css"></style>
<style src="../../assets/CSS/register.css"></style>